/**
 * New node file
 */
var http =  require('http');
var fs = require('fs');
var socketio = require('socket.io');


//서버를 생성합니다.
var server = http.createServer(function (request, response) {
	
	fs.readFile('HTMLPage.htm', function(error, data) {
		
		
		response.writeHead(200,{'Content-Type':'text/html'});
		response.end(data);
		
	});
	
	
}).listen(52273, function(){
	console.log('Server Running at http://127.0.0.1:52273');
});

var io = socketio.listen(server);

io.sockets.on('connection', function(socket) {
	socket.on('rint', function(data) {
		console.log(data);
		socket.emit('smart',data);
	});
});


	